/*
NSTextField.prototype.loadBinding = function(ds) {
	this.text = ds.getField(this.dataField)
}

NSTextField.prototype.commitBinding = function(ds) {
	ds.setField(this.dataField, this.text)
}

NSBox.prototype.loadBinding = function(ds) {
	this.radioValue = ds.getField(this.dataField)
}

NSBox.prototype.commitBinding = function(ds) {
	ds.setField(this.dataField, this.radioValue)
}

NSButton.prototype.loadBinding = function(ds) {
	if (this.type == "checkbox") {
		if (ds.getField(this.dataField))
			this.checked = true
			else
				this.checked = false
				}
}

CocoalTable.prototype.loadBinding = function(ds) {
	this._bindColumns = this.dataField.split(",")
	this.reload()
}

*/

UI.TableView.prototype._RowCount = function() {
	if (this.items != null)
		return this.items.length
	
	if (this.dataSource != null) {
		return this.dataSource.getCount()
	}
	
	if (this.RowCount != null)
		return this.RowCount.call(this.form);
	return 0;
}

UI.TableView.prototype._Row = function() {
	if (this.items != null)
		return this.items[event.row]

	if (this.dataSource != null) {
		return this.dataSource.getRow(event.row, this._bindColumns);
	}
	
	if (this.Row != null)
		return this.Row.call(this.form);
	return "";
}

UI.OutlineView.prototype._RowCount = function() {
	if (this.items != null)
		return this.items.length

	if (this.RowCount != null)
		return this.RowCount.call(this.form);
	return 0;
}

UI.OutlineView.prototype._Row = function() {
	if (this.items != null)
		return this.items[event.row]

	if (this.Row != null)
		return this.Row.call(this.form);
	return "";
}

UI.OutlineView.prototype._GetItemDesc = function(item) {
	if (item.text != null)
		return item.text
	if (item.getText != null)
		return item.getText()
	return "item"
}

UI.OutlineView.prototype._GetSubCount = function(parent) {
	if (parent.items != null)
		return parent.items.length
	if (parent.getCount != null)
		return parent.getCount()
	return 0
}

UI.OutlineView.prototype._GetSubItem = function(parent, row) {
	if (parent.items != null)
		return parent.items[row]
	if (parent.getItem != null)
		return parent.getItem(row)
	return "missing item"
}

UI.BrowserView.prototype._RowCount = function() {
	if (this.RowCount != null)
		return this.RowCount.call(this.form);
	return 0;
}

UI.BrowserView.prototype._Row = function() {
	if (this.Row != null)
		return this.Row.call(this.form);
	return "";
}
